<script type="text/javascript" src="/um/umeditor.config.js"></script>
<script type="text/javascript" src="/um/umeditor.min.js"></script>
<link href="/um/themes/default/css/umeditor.min.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="/src/js/messenger.min.js "></script>
<link rel="stylesheet" type="text/css" href="/src/css/messenger.css">
<link rel="stylesheet" type="text/css" href="/src/css/messenger-theme-ice.css">
<script type="text/javascript">
	$("body").css("background-color","rgb(247,247,247)");
</script>

<div class="row" >
	<div class="row">
		<a href="/index.php/Index" class="glyphicon glyphicon-comment"><span class="text-danger">文章/</span></a>{$post['pd']|pd}
	</div>
	<div class="row">
		<h2>{$post['title']}</h2>
		<p style="color:rgb(204,198,199)">
			{$post['view']}围观.{$post['renum']}评论.{$post['mark']}收藏.发布于{$post['time']|date="Y-m-d H:i",###}
		</p>
	</div>
	<hr>
	<div class="row">
		{$post['text']}
		<div>
			<h3><small>标签</small></h3>
			<p>
				{$post['tag']|posttag}
			</p>			
		</div>
		<hr/>
		<div AM="UP">
			<p>
				<a href="/index.php/Index/user/uid/{$post['uid']}">
				<img src="{$post['uid']|uidimage}" width="50px">
				{$post['uid']|uidname}
				</a>
				<span class="btn btn-danger btn-sm" style="border-radius:20px;" id="start"><span class="glyphicon glyphicon-star-empty"></span></span>
			</p>
			
		</div>
		<hr/>
	</div>
	<div class="row" >
		<div class="col-md-3"><h2><img src="/src/img/icon_comment.png"><small>评论区:</small></h2></div>
		<div class="col-md-2 col-md-offset-7"><span id="top" class="btn btn-danger ">发表评论</span></div>
		<div class="col-md-12">
			{$page}
		</div>
	</div>
	<div class="row" id="comment_1">

		
	</div>
	<div class="row" id="comment_3">
		
	</div>


	<div class="row">
		<volist name="repost" id="repo" key="k">
			<div style="border:dashed 1px rgb(207,207,207);
			<?php
				if(count($repo)>1){
				 echo "background-color:rgb(255,255,238)";
				}
			?>

			" >
			<volist name="repo" id="re">
			<blockquote>
			<div class="row" id="{$re['rid']}" >
				<div class="media">
					<div class="media-left">
						<a href="/index.php/Index/user/uid/{$re['uid']}"><img class="media-object " src="{$re['uid']|uidimage}" width="50px"></a>
					</div>
					<div class="media-body">
						<div class="row">
							<div class="col-md-3">
								<p id="user">#{$re[num]} <a href="/index.php/Index/user/uid/{$re['uid']}">{$re[uid]|uidname}</a></p>
							</div>
							<div class="col-md-3 col-md-offset-6">
								<p class="text-right">{$re[time]|date="Y-m-d H:i",###}</p>
							</div>
							<div class="col-md-12">
								{$re['text']}
								<p class="text-right">
									<click id={$k}{$i}  value="{$re['rid']}">引用</click>|<a href="">举报</a>|<a href="">私信</a>					
								</p>
							</div>
						</div>
					</div>
				</div>

				<div id="comment_{$k}{$i}">
					
				</div>
			</div>
			</volist>
			</blockquote>
			</div>
			<hr>
		</volist>
	</div>



</div>
	
	<div class="row" id="comment_2">

		
	</div>
	<div class="hide" id="xxx">
		
	</div>


<div class="row" style="border:dashed 1px rgb(207,207,207)" id="comment" name="pl">
	
	<input type="text"  class="hide" id="pid" name="pid" value={$_GET['pid']}>
	<textarea  name="text"   id="text" style="width:100%;height:200px">
	</textarea>
	<span id="send" class="btn btn-success glyphicon glyphicon-ok-circle">发送评论</span>
</div>



		<div id="ex">
			<div class="row" style="display:none" >
				<div class="media">
					<div class="media-left">
						<img class="media-object " src="/src/img/tx.jpg" width="50px">
					</div>
					<div class="media-body">
						<div class="row">
							<div class="col-md-3">
								<p id="user">#NUM UID</p>
							</div>
							<div class="col-md-3 col-md-offset-6">
								<p class="text-right">TIME</p>
							</div>
							<div class="col-md-12">
								TEXT
								<p class="text-right">
									<click value="NUM">引用</click>|<a href="">举报</a>|<a href="">私信</a>					
								</p>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
<script type="text/javascript">
        um = UM.getEditor('text',{toolbar:[" bold italic underline strikethrough | fontfamily fontsize | emotion image "]});
</script>
<script type="text/javascript">
var rrid=0;
var pid=$("#pid").val();
	$("#send").click(function(){
		var pid=$("#pid").val();
		var tex=um.getContentTxt();
		var text= um.getContent();
		if(tex.length<5){
			alert("回复不能小于5个字");//change
		}else{
			var fd=new FormData();
			fd.append("pid",pid);
			fd.append("text",text);
			fd.append("rrid",rrid);
			$.ajax({
				type:"POST",
				url:"/index.php/Index/re",
				data:fd,
				processData: false,  // 告诉jQuery不要去处理发送的数据
  				contentType: false,   // 告诉jQuery不要去设置Content-Type请求头
  				success:function(data){
  					if(data.join){
  						window.location.href="/index.php/User/login";
  					}else{
  						location.reload();
  					}
  				}
			})
		}
	})
		$("click").click(function(){
			var a=$(this).attr("id");
			var ra=$(this).attr("value");
			var comment=$("#comment");
			rrid=ra;
			$("#comment_"+a).append(comment);
			//location.href="#pl";
		})
		$("#top").click(function(){
			var comment=$("#comment");
			$("#comment_1").append(comment);

		})


	$._messengerDefaults = {//
  		extraClasses: 'messenger-fixed messenger-theme-ice messenger-on-bottom messenger-on-left'
	}

	$("#start").click(function(){
		$.get(
			"/index.php/Post/mark/pid/"+pid,
			function(data){
				if(typeof(data.z)=="undefined"){
					mx=Messenger().post("请先<b><a href=/index.php/User/login>登入</a></b>");
				}else{
					if(data.z=="success"){
						mx=Messenger().post(data.com);
					}else if(data.z=="error"){
						mx=Messenger().post(data.com);
					}else{
						mx=Messenger().post(data.com);
					}
				}
				setTimeout("mx.hide()","3000");
			}
		)
	})
	//mx=Messenger().post("Welcome to the darkside (tm)")
	//mx.update("xx");
</script>


